import request from "../utils/request";

/**
 * 获取商品列表通过立即购买
 */
export const getGoodsListByBuyNowApi = (goodsId, blessing) => {
  return request(`/order/buy/${goodsId}`, { blessing });
};

/**
 * 获取商品列表通过购物车
 */
export const getGoodsListByShopcartApi = () => {
  return request(`/order/trade`);
};

/**
 * 提交订单（得到订单号）
 */
export const submitOrderApi = (data) => {
  return request(`/order/submitOrder`, data, "POST");
};

/**
 * 微信下单（得到用于微信支付的各种参数）
 */
export const getWeiXinPayParamsApi = (orderNo) => {
  return request(`/webChat/createJsapi/${orderNo}`);
};
